package com.da.javatest.leetCode;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author chenlida
 * @date 2019/1/15 14:32
 * @description
 */
public class Code386 {
    public List<Integer> lexicalOrder(int n) {
        List<Integer> list = new ArrayList<>();
        for (int i = 1; i <= n; i++) {
            list.add(i);
        }
        return list.stream().sorted(Comparator.comparing(x -> (x + ""))).collect(Collectors.toList());
    }
}
